1. Field of the Invention
The present invention relates to a phase difference detection method, a phase difference detection apparatus, a range finding apparatus and an imaging apparatus.
2. Description of the Related Art
In a conventional automatic focusing camera and the like, when focusing on an object to be photographed by use of a so-called passive system, in the case of a non-TTL camera, the distance to the object is detected by use of an image of the object which does not pass through a taking lens. Thereafter, a position of the taking lens is controlled in response to the detected distance to the object. In the case of a TTL camera, a shift amount from a focused state is detected by use of an image of the object obtained through the taking lens. Thereafter, the rotational position of the taking lens is controlled in response to the detected shift amount. The principle of the above-described series of operations will be described below with reference to FIG. 7A.
As shown, a pair of lenses 1a and 1b are disposed apart from each other by a predetermined base line length b, and images of an object 2 are respectively formed through optical paths A and B which are different from each other on a pair of optical sensor arrays 3a and 3b which are disposed apart from the pair of lenses 1a and 1b by a focal distance f. It is assumed that the object 2 is located at a position in front of the pair of lenses la and 1b by a distance L.
When the object 2 is located at a distance L of infinity, centers of the images formed on the pair of optical sensor arrays 3a and 3b are formed at reference positions (3a1, 3b1) on the optical sensor arrays 3a and 3b which correspond to optical axes of the lenses 1a and 1b. However, when the object 2 is closer than a distance of infinity, the images are formed at positions which are shifted by an amount xcex1 from the reference positions (3a1, 3b1). Based on the principle of triangular ranging, the distance L to the object 2 equals bf/xcex1. Here, since the base line length b and the focal distance f are constants, if the shift amount xcex1 is detected, the distance L can be calculated. This is the principle of passive ranging (so-called outside light triangular ranging), which is used in the non-TTL camera. In the non-TTL camera the shift amount xcex1 may be used as it is for calculation purposes instead of using the distance L as an output value of a range finding apparatus.
In the case of the TTL camera, by applying a light passed through an imaging lens (not shown) to the pair of lenses 1a and 1b in the same manner as described above, the shift amount xcex1 between a pair of left and right images is detected. In this case, it is assumed that centers of images in case of a focused state are reference positions on the respective optical sensor arrays 3a and 3b. Thus, positive and negative values of the shift amount xcex1 indicate a front focus state and a rear focus state, respectively, and the absolute values thereof indicate an extent of the shift from in-focus. In the present specification, the shift amount xcex1 is referred to as a phase difference.
In any of the cameras described above, the image of an object to be photographed is formed on the pair of optical sensor arrays by an optical system, and a relative shift of the pair of image signals output by the pair of optical sensor arrays, i.e., the phase difference, is detected by carrying out a process known as correlation calculation about partial image data groups (see FIG. 7B) extracted from the pair of image signals, respectively. In addition, the phase difference detection described above is not limited to automatic focusing cameras but can be used for various range finding apparatuses, focal point detection apparatuses, and the like, which measure the distance to an object or focus on an object.
In an apparatus which uses phase difference detection as a method for reducing degradation of detection accuracy due to the presence of a back-light from strong light sources such as the sun, which serve as a background of an object to be photographed (at a time of so-called back-light), there is one such device which is described, for example, in Japanese Patent No. 3,230,759 (JP-A-5-264892). More specifically, it is judged whether or not there is an effect of a flare light acting as a back-light on the output of an optical sensor. When it is judged that there is an effect of a flare light, a compensation value based upon a difference in light intensities of the pair of the image signals and, more particularly, based on a difference in average values of respective image signals, is calculated. The calculated compensation value is added to or subtracted from one of the image signals. The phase difference is then calculated by carrying out the correlation calculation based upon the image signal after performing such compensation.
However, in the case of the technology described in the above Japanese Patent No. 3,230,759 (JP-A-5-264892), there was a necessity for performing complicated calculations for calculating the difference in the average values of respective image signals has in order to calculate the compensation value.
Also, in the above-described reference, since the compensation value is calculated only from the difference in average values of respective image signals, there was a possibility that a compensation of high accuracy could not be carried out. For example, as shown in FIG. 8, in the case of an image signal ILX which exists in an image signal IL and which does not exist in an image signal IR, and an image signal IRX which exists in the image signal IR and which does not exist in the image signal IL, even if the compensation value is calculated only based on the difference in average values of the pair of image signals including these image signals ILX and IRX, since the compensation value is affected by the image signals ILX and IRX which are different signals, high accuracy compensation can not be obtained. In FIG. 8, like reference numerals are applied to the like components as in FIG. 7.
An object of the present invention is to provide a phase difference detection method, a phase difference detection apparatus, a ranging (or range finding) apparatus, and an imaging apparatus in which it is possible to avoid complicated calculations in calculating the difference in the average values of the respective image signals needed in order to calculate the compensation value for reducing degradation of detection accuracy due to the presence of a strong light source such as the sun or the like which exists in the background or the like of an object to be observed.
Another object of the present invention is to provide a phase difference detection method, a phase difference detection apparatus, a range finding apparatus, and an imaging apparatus in which it is possible to reduce the effect of an image signal which exists in only one of the pair of image signals on the compensation value used in image signal compensation for reducing degradation of detection accuracy due to the presence of a strong light source such as the sun or the like which exists in the background or the like of the object.
A phase difference detection method according to a first aspect of the present invention comprises a compensation step of compensating for a difference in a pair of image data rows which are comprised of a plurality of image data values generated in response to outputs of a pair of optical sensor arrays on which images of an object are formed, based upon a difference in maximum image data values in each of the pair of image data rows and a difference in minimum image data values in each of the pair of image data rows, and a detection step of detecting a phase difference between the images formed on the pair of optical sensor arrays based upon the pair of image data rows after performing the compensation.
By the foregoing method, since compensation of the pair of image data rows is carried out based upon the difference in maximum image data values in each of the pair of image data rows and the difference in minimum image data values in each of the pair of image data rows, it is possible to effectively avoid performing complicated calculations associated with calculation of the difference in average values of respective image signals in order to calculate the compensation value for reducing degradation of detection accuracy due to the presence of a strong light source such as the sun or the like which exists in the background or the like of the object, and it is possible to simplify the processes for compensation processing.
In accordance with a second aspect of the invention, the compensation step comprises the step of compensating for a difference in the pair of image data rows based upon the difference in the maximum image data values and the difference in the minimum image data values and an average value of image data in each of the image data rows. According to such method, since the compensation value is calculated based upon the difference in maximum image data in each of the pair of image data rows and the difference in the minimum image data in each of the pair of image data rows as well as the average values of the respective image signals, it becomes possible to reduce the effect caused by an image signal which exists in only one of the pair of image signals on the compensation value which occurs in case that the compensation value was calculated only from the average value of the respective image signals. Stated otherwise, in accordance with the second aspect of the invention, the compensation value of the first aspect of the invention is compensated based upon the average value of the respective image signals, so that high accuracy compensation becomes possible.
In accordance with a third aspect of the invention, a phase difference detection apparatus is provided which comprises a pair of optical sensor arrays on which images of an object are formed, a compensation unit for compensating for a difference in a pair of image data rows which are comprised of a plurality of image data values generated in response to outputs of the pair of optical sensor arrays, the compensation being performed based upon a difference in maximum image data values in each of the pair of image data rows and a difference in minimum image data values in each of the pair of image data rows, and a phase difference detection unit for detecting a phase difference between the images formed on the pair of optical sensor arrays based upon the pair of image data rows after the compensation is performed by the compensation unit.
By the foregoing structure, since the difference of the pair of image data rows is compensated based upon the difference of maximum image data in each of the pair of image data rows and the difference of the minimum image data in each of the pair of image data rows, it is possible to effectively reduce the complicated calculation for calculating the difference of average values of respective image signals in order to calculate the compensation value for reducing degradation of detection accuracy due to the presence of a strong light source such as the sun or the like which exists in the background of the object, or the like, and it is possible to simplify the processes for compensation processing.
In accordance with a fourth aspect of the invention, the compensation unit compensates for a difference in the pair of image data rows based upon the difference in the maximum image data values and the difference in the minimum image data values and an average value of image data in each of the image data rows. According to such structure, since the compensation value is calculated based upon the difference in the maximum image data values in each of the pair of image data rows and the difference in the minimum image data values in each of the pair of image data rows as well as the average values of the respective image signals, it becomes possible to reduce the effect on the compensation value of an image signal which exists in only one of the pair of image signals, which effect occurs when the compensation value is calculated based only on the average value of the respective image signals. Stated otherwise, in accordance with the fourth aspect of the present invention, the compensation value obtained in the third aspect of the invention is compensated based upon the average value of the respective image signals, so that high accuracy compensation becomes possible.
In accordance with a fifth aspect of the invention, a range finding apparatus is provided with the above-described phase difference detection apparatus and a distance detection unit for calculating distance data in response to a distance to the object based upon a phase difference detected by the phase difference detection apparatus. By such structure, it becomes possible to provide a range finding apparatus which realizes the above-described advantages.
In accordance with a sixth aspect of the invention, an imaging apparatus is provided with the above-described phase difference detection apparatus, an objective lens, an image formation unit on which an image of the object passed through the objective lens is formed, and a focusing control unit for carrying out a focusing operation between the objective lens and the image formation unit in response to the phase difference calculated by the phase difference detection apparatus. By such structure, it becomes possible to provide an imaging apparatus which realizes the above-described advantages.